<template>
	<view>
		<block v-if="promotionType == 'genneral_tag'" v-for="(promotionItem, index) in promotionTagData" :key="index" :class="promotionItem.promotionType == 'custom_tag' ? 'saleBox' : ''">
		<!-- 提前购标签 -->
		 <view v-if="promotionItem.promotionType == 'forward_purchase'">
		    <view v-if="filterChecked.forwardPurchaseTag(promotionItem.memberLevelIds,memberLevelGroup,memberStatus) && filterChecked.filterCustomerGroupPromotionTag(promotionItem.groupIds,userGroupId)">
		      <span class="goodsTag">{{promotionItem.promotionTag + " "}}</span>
		    </view>
		  </view>
		  <!-- 普通标签 -->
		  <view v-if="promotionItem.promotionType !== 'forward_purchase' && promotionItem.promotionType !== 'custom_tag'">
			<view v-if="filterChecked.filterCustomerGroupPromotionTag(promotionItem.groupIds,userGroupId)">
		      <span class="goodsTag">{{promotionItem.promotionTag + " "}}</span>
		    </view>
		  </view>
		</block>
		<!-- 自定义标签 -->
		<block v-if="promotionType == 'custom_tag'" v-for="(promotionItem, index) in promotionTagData" :key="index" class="saleBox">
			<view v-if="promotionItem.promotionType == 'custom_tag'">
				<view v-if="filterChecked.filterCustomerGroupPromotionTag(promotionItem.groupIds,userGroupId)">
				<span class="customGoodsTag" :style="{color:promotionItem.tagStyle}">{{promotionItem.promotionTag + "   "}}&#32;</span>
				</view>
			</view>
		</block>
	</view>
</template>

<script module="filterChecked" lang="wxs" src="../../utils/filter.wxs"></script>
<script>
	export default{
		name: 'promotionTagsTpl',
		props: {
		  promotionTagData:Array,
		  memberLevelGroup: String,
		  memberStatus: String,
		  userGroupId: String,
		  promotionType:String
		},
	}
</script>

<style lang="less">
	// 促销
	.saleBox {
	  display: flex;
	  justify-content: left;
	  line-height: 36rpx;
	  flex-flow: row wrap;
		margin:10rpx 0 -10rpx;
	}
	
	.saleBox label {
	  color: #FF571A;
	  font-size: 24rpx;
	  margin-right: 30rpx;
	}
	.goodsTag {
	  color: #FF571A !important;
	  font-size: 24rpx;
	  margin-right: 14rpx
	}
	
	.customGoodsTag {
	  font-size: 24rpx;
	}
</style>
